package les_rivieres;


/**
 * 
 * @author Joel DURET, Ludivine ROYO et Gaetan ROYO
 */

public class segment_oriente extends segment {
	/**
	 * Un segment oriente est un segment avec un point d'entree et un point de sortie on sait quel
	 * point est l'amont et quel point est l'aval
	 * */
	public segment_oriente(point point1, point point2) {
		super(point1, point2);
	}

	@Override
	/**
	 * redefinition de la methode tostring
	 * Amont : lepointamont (pointX; pointY; pointH) 
	 * Aval : lepointaval (pointX; pointY; pointH) 
	 * */
	public String toString() {
		String text = "";
		if (this.getPoint(0).getNom() != null) {
			text += "Amont : " + this.getPoint(0).getNom() + " ";
		}
		text += "(" + this.getPoint(0).getX() + " ; " + this.getPoint(0).getY()
				+ " ; " + this.getPoint(0).getH() + " ) ";
		if (this.getPoint(1).getNom() != null) {
			text += "Aval : " + this.getPoint(1).getNom() + " ";
		}
		text += "( " + this.getPoint(1).getX() + " ; "
				+ this.getPoint(1).getY() + " ; " + this.getPoint(1).getH()
				+ " ) ";
		return text;
	}
}
